namespace JQuery.WebKit
{
    using System.ComponentModel;
    using System.Security.Permissions;
    using System.Web;
    using System.Web.UI;

    [TypeConverter(typeof(ExpandableObjectConverter)), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public sealed class AppearanceSettings : IStateManager
    {
        private bool _isTracking;
        private StateBag _viewState = new StateBag();

        void IStateManager.LoadViewState(object state)
        {
            if (state != null)
            {
                ((IStateManager) this.ViewState).LoadViewState(state);
            }
        }

        object IStateManager.SaveViewState()
        {
            return ((IStateManager) this.ViewState).SaveViewState();
        }

        void IStateManager.TrackViewState()
        {
            this._isTracking = true;
            ((IStateManager) this.ViewState).TrackViewState();
        }

        public override string ToString()
        {
            return string.Empty;
        }

        [NotifyParentProperty(true), DefaultValue(false), Category("Appearance"), Description("Controls if the background should have alternate background for odd/even rows.")]
        public bool AlternateRowBackground
        {
            get
            {
                object obj2 = this.ViewState["AlternateRowBackground"];
                if (obj2 == null)
                {
                    return false;
                }
                return (bool) obj2;
            }
            set
            {
                this.ViewState["AlternateRowBackground"] = value;
            }
        }

        [DefaultValue(""), NotifyParentProperty(true), Description("The caption of the grid. Appears on top and can collapse expand the grid by clicking on it."), Category("Appearance")]
        public string Caption
        {
            get
            {
                object obj2 = this.ViewState["Caption"];
                if (obj2 == null)
                {
                    return string.Empty;
                }
                return (string) obj2;
            }
            set
            {
                this.ViewState["Caption"] = value;
            }
        }

        [DefaultValue(false), Description("Controls if the background color of a row will change when end-users hover the mouse over it."), NotifyParentProperty(true), Category("Appearance")]
        public bool HighlightRowsOnHover
        {
            get
            {
                object obj2 = this.ViewState["HighlightRowsOnHover"];
                if (obj2 == null)
                {
                    return false;
                }
                return (bool) obj2;
            }
            set
            {
                this.ViewState["HighlightRowsOnHover"] = value;
            }
        }

        [DefaultValue(false), Description("Sets the grid in RightToLeft (RTL) mode."), NotifyParentProperty(true), Category("Appearance")]
        public bool RightToLeft
        {
            get
            {
                object obj2 = this.ViewState["RightToLeft"];
                if (obj2 == null)
                {
                    return false;
                }
                return (bool) obj2;
            }
            set
            {
                this.ViewState["RightToLeft"] = value;
            }
        }

        [Category("Appearance"), DefaultValue(0x19), NotifyParentProperty(true), Description("Set the width of the row numbers column (ShowRowNumbers must be true). Default is 25.")]
        public int RowNumbersColumnWidth
        {
            get
            {
                object obj2 = this.ViewState["RowNumbersColumnWidth"];
                if (obj2 == null)
                {
                    return 0x19;
                }
                return (int) obj2;
            }
            set
            {
                this.ViewState["RowNumbersColumnWidth"] = value;
            }
        }

        [Category("Appearance"), DefaultValue(0x12), NotifyParentProperty(true), Description("The caption of the grid. Appears on top and can collapse expand the grid by clicking on it.")]
        public int ScrollBarOffset
        {
            get
            {
                object obj2 = this.ViewState["ScrollBarOffset"];
                if (obj2 == null)
                {
                    return 0x12;
                }
                return (int) obj2;
            }
            set
            {
                this.ViewState["ScrollBarOffset"] = value;
            }
        }

        [NotifyParentProperty(true), DefaultValue(false), Category("Appearance"), Description("Shows an expand/collapse button in the caption of the grid which toggles grid visibility.")]
        public bool ShowCaptionGridToggleButton
        {
            get
            {
                object obj2 = this.ViewState["ShowCaptionGridToggleButton"];
                if (obj2 == null)
                {
                    return false;
                }
                return (bool) obj2;
            }
            set
            {
                this.ViewState["ShowCaptionGridToggleButton"] = value;
            }
        }

        [Category("Appearance"), DefaultValue(false), Description("Displayes a static footer for each grid column. You can store custom information there, like formulas, sum, count, etc."), NotifyParentProperty(true)]
        public bool ShowFooter
        {
            get
            {
                object obj2 = this.ViewState["ShowFooter"];
                if (obj2 == null)
                {
                    return false;
                }
                return (bool) obj2;
            }
            set
            {
                this.ViewState["ShowFooter"] = value;
            }
        }

        [NotifyParentProperty(true), DefaultValue(false), Category("Appearance"), Description("Show row numbers (index) in the leftmost column of the grid")]
        public bool ShowRowNumbers
        {
            get
            {
                object obj2 = this.ViewState["ShowRowNumbers"];
                if (obj2 == null)
                {
                    return false;
                }
                return (bool) obj2;
            }
            set
            {
                this.ViewState["ShowRowNumbers"] = value;
            }
        }

        [DefaultValue(true), Description(""), Category("Appearance"), NotifyParentProperty(true)]
        public bool ShrinkToFit
        {
            get
            {
                object obj2 = this.ViewState["ShrinkToFit"];
                return ((obj2 == null) || ((bool) obj2));
            }
            set
            {
                this.ViewState["ShrinkToFit"] = value;
            }
        }

        bool IStateManager.IsTrackingViewState
        {
            get
            {
                return this._isTracking;
            }
        }

        private StateBag ViewState
        {
            get
            {
                return this._viewState;
            }
        }
    }
}

